<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>留言提交信息</title>
</head>

<body>
<?php
include("conn.php");
if(isset($_POST['submit'])  and $_POST['textfield']!=null and $_POST['textarea']!=null and $_POST['submit']=="提交"){
	$insert=mysql_query("insert into books(name,books) values('".$_POST['textfield']."','".$_POST['textarea']."')");
	if($insert){
	echo "<script> alert('发表成功!'); window.location.href='book.php'</script>";
	}else{
	echo "<script> alert('发表失败!'); window.location.href='book1.php'</script>";
	}
}else{
	echo "<script> alert('发表失败!'); window.location.href='book1.php'</script>";
}
?>

</body>
</html>